#!/usr/bin/python3

from tkinter import *
from tkinter import ttk

class App():
    def __init__(self):
        self.root = Tk()

    def addFrame(self):
        self.frame = Frame(self.root)
        self.frame.pack()

    def addScrollbar(self):
        self.scrollbar= Scrollbar(self.frame)
        self.scrollbar.pack(side=RIGHT, fill=Y)
        

    def addListbox(self):
        self.listbox = Listbox(
                self.frame, 
                setgrid=True, 
                yscrollcommand=self.scrollbar.set
                )
        for i in range(100):
            self.listbox.insert(END, i)
        self.listbox.pack(side=LEFT, fill=BOTH)


    def run(self):
        self.addFrame()
        self.addScrollbar()
        self.addListbox()
        self.scrollbar.config(command=self.listbox.yview)
        self.root.mainloop()

if __name__ == "__main__":
    app = App()
    app.run()
